(function() {
    'use strict';

    angular
        .module('milkbeeApp')
        .controller('GlossaryDetailController', GlossaryDetailController);

    GlossaryDetailController.$inject = ['$scope', '$rootScope', '$stateParams', 'previousState', 'entity', 'Glossary'];

    function GlossaryDetailController($scope, $rootScope, $stateParams, previousState, entity, Glossary) {
        var vm = this;

        vm.glossary = entity;
        vm.previousState = previousState.name;

        var unsubscribe = $rootScope.$on('milkbeeApp:glossaryUpdate', function(event, result) {
            vm.glossary = result;
        });
        $scope.$on('$destroy', unsubscribe);
    }
})();
